home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / qbsnip.zip / FINDRGB.BAS < prev    next >
BASIC Source File  |  1997-06-20  |  622b  |  30 lines

  1. ' FINDRGB.BAS
  2. ' Author Unknown
  3. '
  4. ' public domain
  5. ' No warranties or guarantees are expressed or implied.
  6. '
  7. ' Purpose: Find R, G and B of a pixel in a certain location.
  8.  
  9. DECLARE SUB findrgb (x!, y!)
  10.  
  11. SCREEN 13: PALETTE: CLS
  12.  
  13. LINE (100, 40)-STEP(100, 100), 93, BF
  14. findrgb 160, 100
  15. PRINT "RGB at location 160, 100:"; red; green; blue
  16. findrgb 80, 50
  17. PRINT "RGB at location 80, 50:"; red; green; blue
  18.  
  19. PALETTE: SCREEN 0, 0, 0, 0: WIDTH 80: COLOR 7, 0: CLS : END
  20.  
  21. SUB findrgb (x, y)
  22. SHARED red, green, blue
  23. c = POINT(x, y)
  24. OUT &H3C7, c
  25. red = INP(&H3C9)
  26. green = INP(&H3C9)
  27. blue = INP(&H3C9)
  28. END SUB
  29.  
  30.